package Cn.Sarkar.MMS.Entities.Independent.Wallet

import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Wallet.MemberShipLevels
import Cn.Sarkar.Entities.Common.Additional.IDescription
import Cn.Sarkar.Entities.Common.Additional.IName
import Cn.Sarkar.Entities.Common.Independent.IApplicationDomain
import Cn.Sarkar.MMS.Entities.Additional.Description
import Cn.Sarkar.MMS.Entities.Additional.Name
import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.MMS.Independent.Wallet.IMemberShipLevel
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Permission.PermissionGroups
import Cn.Sarkar.MMS.Entities.Independent.ApplicationDomain

class MemberShipLevel(DataContext: IDataContext) : BaseEntity(DataContext, MemberShipLevels), IMemberShipLevel {
    var applicationDomainID by MemberShipLevels.ApplicationDomainID
    override var applicationDomain: IApplicationDomain by hasOne(PermissionGroups.ApplicationDomainID) { ApplicationDomain(it) }
    var nameID by MemberShipLevels.NameID
    override var name: IName by hasOne(MemberShipLevels.NameID) { Name(it) }
    var descriptionID by MemberShipLevels.DescriptionID
    override var description: IDescription by hasOne(MemberShipLevels.DescriptionID) { Description(it) }
    override var supportDiscount: Boolean by MemberShipLevels.SupportDiscount
    override var discountPercent: Float by MemberShipLevels.DiscountPercent
    override var supportIntegral: Boolean by MemberShipLevels.SupportIntegral
    override var howMuchIsOneIntegral: Float by MemberShipLevels.HowMuchIsOneIntegral
    override var forActivetionIntegral: Float by MemberShipLevels.ForActivetionIntegral
    override var supportStoredValue: Boolean by MemberShipLevels.SupportStoredValue
}